{% extends "base.html" %}
{% load thumbnails %}



{% block title %}{% if page_title %}{{ page_title }}{% else %}Comprehensive{% endif %} Discography{% endblock title %}

{% block style_path %}http://static.bryanlewissaunders.org/css/discography.css{% endblock %}

{% block content %}

{% if object_list %}
{% autoescape off %}{% comment %} This allows content with HTML <tags> to be displayed.{% endcomment %}

<div class="discography">

{% for object in object_list %}
	<div class="publication">
		<div class="left">
			<div class="album_title">
				<h2><a href="{% url discography.views.publication_single slug=object.slug %}" title="{{ object.title|fix_ampersands }}">{{ object.title|fix_ampersands }}</a></h2>
			</div><!-- end album_title -->
						
			<div class="album_year">
				{{ object.year }}
			</div><!-- end album_year -->
			<div class="album_catalog_number">
				{{ object.catalog_number|fix_ampersands }}
			</div><!-- end album_catalog_number -->
			<div class="album_media_format">
				{{ object.media_format|fix_ampersands }}
			</div><!-- end album_media_format -->
			
			<div class="album_publisher">
				Published by: {% if object.published_by.link %}<a href="{{ object.published_by.link }}" title="{{ object.published_by|fix_ampersands }}">{% endif %}
					{{ object.published_by|fix_ampersands }}
				{% if object.published_by.link %}</a>{% endif %}
			</div><!-- end album_publisher -->
			
			{% comment %}
			<div class="album_short_credits">
				{{ object.short_credits|fix_ampersands }}
			</div><!-- end album_short_credits"-->
			{% endcomment %}
			
			<div class="album_long_credits">
				{{ object.long_credits|fix_ampersands }}
			</div><!-- end album_long_credits -->
			

			
			<div class="album_tracklist">
			<ul>
				{% for track in object.track_set.all %}
					{% if track.media_file %}
						<li>{{ track.number }} - <a href="{{ track.get_media_file_url }}" title="{{ track.name|fix_ampersands }}">{{ track.name|fix_ampersands }}</a> - {{ track.length }}</li>
					{% else %}
						<li>{{ track.number }} - {{ track.name|fix_ampersands }} - {{ track.length }}</li>
					{% endif %}				
				{% endfor %}
			</ul>
			</div><!-- end album_tracklist -->
		</div><!-- end left -->

		<div class="right">
			<div class="album_art">
            <a href="{% url discography.views.publication_single slug=object.slug %}">
				{% with object.image_file|thumbnail:"256x512" as image_thumb %}
				{% if image_thumb %}
				<img alt="{{ object.title|fix_ampersands }}" src="{{ image_thumb.url }}" height="{{ image_thumb.thumbnail.size.1 }}" width="{{ image_thumb.thumbnail.size.0 }}" /><br />
				{% else %}
				<img alt="{{ object.title|fix_ampersands }}" src="http://media.bryanlewissaunders.org/{{ object.image_file }}"  width="{{ object.get_image_file_width }}" height="{{ object.get_image_file_height }}" /><br />
				{% endif %}
				{% endwith %}
            </a>
			</div><!-- end album_art -->
		</div><!-- end right -->	
		
		<div class="bottom">
        {% comment %}
			<div class="album_commentary">
				{{ object.commentary|fix_ampersands }}
			</div><!-- end album_commentary-->
        {% endcomment %}
		</div><!-- end bottom -->
	</div><!-- end publication -->
{% endfor %}

</div><!-- end discography -->

{% endautoescape %}
{% else %}
	<p align="center">This {% if page_title %}{{ page_title|fix_ampersands }}{% else %}Comprehensive{% endif %} discography is empty.</p>
{% endif %}

{% endblock content %}
